package org.example.game.weekly.game440;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/08/03 20:45
 */
public class Solution001 {

    public static void main(String[] args) {

        System.out.println(new Solution001().numOfUnplacedFruits(new int[]{4, 2, 5}, new int[]{3,5,4}));
    }

    public int numOfUnplacedFruits(int[] fruits, int[] baskets) {

//        Arrays.sort(fruits);
//        Arrays.sort(baskets);

        List<Integer> basketList = new ArrayList<>();

        for (int i = 0; i < fruits.length; i++) {
            for (int j = 0; j < baskets.length; j++) {
                if(basketList.contains(j)){
                    continue;
                }
                if(baskets[j] >= fruits[i]){
                    basketList.add(j);
                    break;
                }
            }
        }

        return baskets.length - basketList.size();
    }

}
